/// <reference path="jquery.min.js" />
/// <reference path="rsseasy.min.js" />
/// <reference path="md5.min.js" />
/// <reference path="rsseasy.weixin.js" />

//APP配置基本信息
var RssApp = {};
RssApp["WwwHost"] = "http://admin.ixinyun.cn/";
RssApp["ApiHost"] = RssApp.WwwHost + "api/";
RssApp["UpHost"] = "http://weixin.ixinyun.cn/upfile/";
RssApp["AllPage"] = $("section");  //获取所有页
RssApp["CurPage"] = RssApp["AllPage"].first().show();  //默认第一页
RssApp["Menu"] = $("footer>a");   //主菜单
RssApp["Width"] = $(window).width();  //APP窗口宽度
RssApp["WinHeight"] = $(window).height();  //APP窗口高度
RssApp["SmsCode"] = "";  //发送的短信验证码
RssApp["ReadyData"] = {};  //当APP启动
//RssTask.synctime(RssApp.ApiHost + "time.php");
RssVideo.player = document.getElementById("videoplay");

RssApp["Menu"].click(function () {
    RssApp["Menu"].removeClass();
    $(this).addClass("active");
});

//所有单页
var RssPage = {};
RssPage["MaskLayer"] = $("#masklayer");
RssPage.Append = function (pageid) {
    this.page = $(pageid);
    this.header = this.page.find(">header");
    this.title = this.header.find(">h1");
    this.left = this.header.find(".left");
    this.right = this.header.find(".right");
    this.article = this.page.find(">article");
    this.footer = this.page.find(">footer");
};
$("section").each(function ()//通过循环将section增加到RssPage中
{
    var id = this.id;//获取每个section的id值
    if (id) {
        RssPage[id] = new RssPage.Append("#" + id);//此值作为键名
    }
});

//返回功能
$(".hisback").click(function (ev) {
    ev.preventDefault();
});

//单页切换
window.onhashchange = function () {
    RssApp["AllPage"].hide();
    var hash = location.hash;
    $("video").each(function () {
        this.pause();
    });
    if (hash) {
        RssMusic.stop();
        RssVideo.stop();
        RssApp["Menu"].filter("[href='" + hash + "']").click();//改变菜单样式，调用方法：RssApp["Menu"].click()
        document.title = $(hash + " header h1").text() || document.title;
        $(hash).show().load();
        return;
    }
    RssApp["AllPage"].first().show().load();
};
window.onhashchange();

$("[contenteditable]").keydown(function (ev) {
    if (ev.keyCode === 9) {
        ev.preventDefault();
    }
});

//AJAX配置信息
Ajax.prototype.prikey = "www.rsseasy.com";  //数据签名密钥
Ajax.prototype.host = RssApp["ApiHost"];   //AJAX请求时URL地址相同部份
Ajax.prototype.oncreate = function () {
    if (RssUser.Data.myid) {
        this.params["myid"] = RssUser.Data.myid;
    }
};

var KeChengEntity = {"kechengid": 0};
var WenDaEntity = {"zhuanjiaid": 0};